#pragma once
#include "resource.h"
#include "ChartViewer.h"
#include "Global.h"
// CSysMonChart dialog
class CChartMultiData;
class XYChart;
class CSysMonChart : public CDialogEx
{
	DECLARE_DYNAMIC(CSysMonChart)

public:
	CSysMonChart(CWnd* pParent = NULL);   // standard constructor
	virtual ~CSysMonChart();

// Dialog Data
	enum { IDD = IDD_SYSMON_CHART };

	double m_timeStamps[MAX_COUNT];
	double m_volData[MAX_COUNT];
	double m_highData[MAX_COUNT];
	double m_lowData[MAX_COUNT];
	double m_openData[MAX_COUNT];
	double m_closeData[MAX_COUNT];
	double m_BandHH[MAX_COUNT];
	double m_BandHL[MAX_COUNT];
	double m_BandLH[MAX_COUNT];
	double m_BandLL[MAX_COUNT];
	double m_DayH[MAX_COUNT];
	double m_DayL[MAX_COUNT];

	double m_ULH[MAX_COUNT];
	double m_ULL[MAX_COUNT];
	double m_BLH[MAX_COUNT];
	double m_BLL[MAX_COUNT];

	int m_noOfPoints;
	CChartMultiData* m_pMainData;

	void SetData(CChartMultiData* a_Data);
	void SetBandData();
	void SetDayHighLow();
	void SetLimitHighLow();
	void RefreshChart();
protected:
	HICON m_hIcon;
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnMouseMovePlotArea();
	afx_msg void OnViewPortChanged();

private:
	CChartViewer m_ChartViewer;
	void drawChart(CChartViewer *viewer);
	void trackFinance(MultiChart *m, int mouseX);
	void DrawArrow(XYChart* c, DrawArea* d, string a_Name, int a_Time, int a_X, double a_Y, int a_Size, int a_Direc);
	void ShowSignals();
	XYChart* main;
};
